<@mits.headerDiv />
<@mits.showResourceScript "prototype-1.6.0.2.js" />
<@mits.showBrandingResourceScript "ImgCropper.js" />
<@mits.showBrandingResourceScript "Drag.js" />
<@mits.showBrandingResourceScript "Resize.js" />

<script type="text/javascript">
var isIE = (document.all) ? true : false;

var isIE6 = isIE && ([/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1] == 6);

var $ = function (id) {
	return "string" == typeof id ? document.getElementById(id) : id;
};

var Class = {
	create: function() {
		return function() { this.initialize.apply(this, arguments); }
	}
}

var Extend = function(destination, source) {
	for (var property in source) {
		destination[property] = source[property];
	}
}

var Bind = function(object, fun) {
	return function() {
		return fun.apply(object, arguments);
	}
}

var BindAsEventListener = function(object, fun) {
	var args = Array.prototype.slice.call(arguments).slice(2);
	return function(event) {
		return fun.apply(object, [event || window.event].concat(args));
	}
}

var CurrentStyle = function(element){
	return element.currentStyle || document.defaultView.getComputedStyle(element, null);
}

function addEventHandler(oTarget, sEventType, fnHandler) {
	if (oTarget.addEventListener) {
		oTarget.addEventListener(sEventType, fnHandler, false);
	} else if (oTarget.attachEvent) {
		oTarget.attachEvent("on" + sEventType, fnHandler);
	} else {
		oTarget["on" + sEventType] = fnHandler;
	}
};

function removeEventHandler(oTarget, sEventType, fnHandler) {
    if (oTarget.removeEventListener) {
        oTarget.removeEventListener(sEventType, fnHandler, false);
    } else if (oTarget.detachEvent) {
        oTarget.detachEvent("on" + sEventType, fnHandler);
    } else { 
        oTarget["on" + sEventType] = null;
    }
};
</script>

<style type="text/css">
#rRightDown,#rLeftDown,#rLeftUp,#rRightUp,#rRight,#rLeft,#rUp,#rDown{
	position:absolute;
	border: 1px solid #333;
	width: 60px;
	height: 60px;
	z-index:500;
	font-size:0;
	opacity: 0.5;
	filter:alpha(opacity=50);
}

#rLeftDown,#rRightUp{cursor:ne-resize;}
#rRightDown,#rLeftUp{cursor:nw-resize;}
#rRight,#rLeft{cursor:e-resize;}
#rUp,#rDown{cursor:n-resize;}

#rLeftDown{left:0px;bottom:0px;}
#rRightUp{right:0px;top:0px;}
#rRightDown{right:0px;bottom:0px;}
#rLeftUp{left:0px;top:0px;}
#rRight{right:0px;top:50%;margin-top:-4px;}
#rLeft{left:0px;top:50%;margin-top:-4px;}
#rUp{top:0px;left:50%;margin-left:-4px;}
#rDown{bottom:0px;left:50%;margin-left:-4px;}

#bgDiv{width:400px; height:300px; border:1px solid #666666; position:relative;}
#dragDiv{border:1px dashed #FFFF00; width:200px; height:150px; top:100px; left:100px; cursor:move; }
</style>
<div class="Main" id="Main">
	<!--屏幕切换-->
   
    
    
	<!--左边-->
	<!--右边-->
	<div class="Main_body" id="Main_body">
	
  				<table width="100%" border="0" cellspacing="0" cellpadding="0">
  				<#if trackLog?exists && trackLog.firstPicPath?exists>
  			<tr>
		    <td width="50%" ondblclick="doubleClikShowImage('${firstPicPath?if_exists}')" ><div id="bgDiv" >
		        <div id="dragDiv"  >
		        </div>
		      </div>
     	 </td>
    		<td ><div id="viewDiv" style="width:400px;height:300px"> </div>
    		</td>
 		 </tr>
 		 <#else>
 			<tr>
		    <td width="50%">
     	 </td>
    		<td ><div id="bgDiv" ><div   style="width:400px;height:200px">  </div></div>
    		</td>
 		 </tr> 		 
 		 </#if>
		</table>	
		
				</div>				  
				  
</div>
 <img id="imgCreat" style="display:none;" />

<script>
<#if trackLog?exists &&  trackLog.firstPicPath?exists>
var ic = new ImgCropper("bgDiv", "dragDiv", "${base}/showimage?firstPicPath=${firstPicPath?if_exists}", {
	Width: ${width?if_exists}, Height:  ${height?if_exists}, Color: "#464646",
	Resize: true,
	Right: "rRight", Left: "rLeft", Up:	"rUp", Down: "rDown",
	RightDown: "rRightDown", LeftDown: "rLeftDown", RightUp: "rRightUp", LeftUp: "rLeftUp",
	Preview: "viewDiv", viewWidth: 400, viewHeight: 300
})
$('bgDiv').focus();
$('bgDiv').style.color = '#464646';
$('dragDiv').style.top = '100px';
$('dragDiv').style.left = '100px';
</#if>

</script>


